﻿@model KhatVongViet.Models.RoleMember
@{
    ViewBag.Title = "Khát Vọng Việt - Thêm Thành Viên Mới";
    Layout = "~/Views/Administrator/Layout.cshtml";
    
    <script src="../../Content/ckeditor/ckeditor.js" type="text/javascript"></script>
    <script src="../../Content/ckfinder/ckfinder.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../Scripts/jquery-ui-1.8.20.min.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery-1.7.1.min.js"></script>
}

<script language="javascript" type="text/javascript">
    var ckeditor;
    function createEditor(languageCode, id) {
        var editor = CKEDITOR.replace(id, { language: languageCode });
        CKFinder.setupCKEditor(null, '../../Content/ckfinder');
    }
    $(function () { createEditor('eg', 'context') })
</script>
<script language="javascript" type="text/javascript">
    $(function () {
        $("#Browser").click(function () {
            var ckfinder = new CKFinder();
            ckfinder.selectActionFunction = function (fileUrl) {
                $("#Images").val(fileUrl)
            };
            ckfinder.popup();
        });

    });
    
</script>

<h1>
    Thêm thành viên mới</h1>
@using (Html.BeginForm("CreateMember", "Administrator", FormMethod.Post,
                            new { enctype = "multipart/form-data" }))
{  
    <table>
        <tr style="vertical-align: middle;">
            <td>
                Chức vụ
            </td>
            <td>
                @Html.DropDownList("RoleId", (SelectList)ViewBag.RoleId, "--Chọn chức vụ--", new { style = "width: 155px;" })
            </td>
        </tr>
        <tr>
            <td style="vertical-align: middle;">
                Tên
            </td>
            <td>
                @Html.TextArea("name")
            </td>
        </tr>
        <tr>
            <td style="vertical-align: middle;">
                Tóm tắt
            </td>
            <td>
                @Html.TextArea("summary")
            </td>
        </tr>
        <tr>
            <td>
                Ảnh đại diện
            </td>
            <td>
                <input id="Images" name="Images" type="text" readonly="true"/>
                <input id="Browser" type="button" value="Browser Images"/>
            </td>
        </tr>
        <tr>
            <td style="vertical-align: middle; text-align: center">
                Thông tin
            </td>
            <td>
                <textarea id="context" name="context"></textarea>
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                <input type="submit" name="Insert" value="Thêm mới" />
            </td>
        </tr>
    </table>
}

